<?php $show_validator = true; include TMPL_PATH.'public/header.phtml';?>
<div class="subnav">
    <div class="content-menu ib-a blue line-x">
    		<a href='<?php echo U('order/order_purchase_list');?>' ><em>退换货申请列表</em></a><span>|</span>
        <a href='javascript:;' class="on" ><em>退换货记录</em></a></div>
</div>
<script type="text/javascript"> 
<!--
	$(function(){
		$.formValidator.initConfig({formid:"myform",autotip:true,onerror:function(msg,obj){window.top.art.dialog({content:msg,lock:true,width:'200',height:'50'}, function(){this.close();$(obj).focus();})}});
		$("#description").formValidator({onshow:"请填写回复内容",onfocus:"请填写回复内容",oncorrect:"输入正确"}).inputValidator({min:2,onerror:"请填写回复内容"});
	})
//-->
</script>
<div class="pad-10">
<div class="col-tab">
<ul class="tabBut cu-li">
<li id="tab_setting_1" class="on" onclick="SwapTab('setting','on','',2,1);">申请信息</li>
<li id="tab_setting_2" onclick="SwapTab('setting','on','',2,2);">反馈信息</li>
</ul>
<div id="div_setting_1" class="contentList pad-10">
<table width="100%"  class="table_form">
   <tr>
    <th width="120">订单号：</th>
    <td class="y-bg"><?php echo $purchaseInfo['order_sn']?></td>
	<tr>
    <th width="120">商品编号：</th>
    <td class="y-bg"><?php echo $purchaseInfo['product_id']?></td>
	</tr>
	<tr>
    <th width="120">商品名称：</th>
    <td class="y-bg"><?php echo $purchaseInfo['product_name']?></td>
	</tr>
	<tr>
    <th width="120">提交数量：</th>
    <td class="y-bg"><?php echo $purchaseInfo['number']?></td>
	</tr>
	<tr>
    <th width="120">服务类型：</th>
    <td class="y-bg"><?php echo OrderModel::$purchaseType[$purchaseInfo['purchase_type']];?></td>
	</tr>
	<tr>
    <th width="120">问题描述：</th>
    <td class="y-bg"><?php echo $purchaseInfo['description']?></td>
	</tr>
	<tr>
    <th width="120">上传图片：</th>
       <td class="y-bg"><?php  
          if(isset($photoList) && $photoList):
          	foreach ($photoList as $photo):
          	$dir = dirname($photo);
          	$img_name = basename($photo);
          	$thumb_img = $dir.'/thumb_'.$img_name;
          ?>
        <div style="margin:10px;float:left;"> <a href="<?php echo $photo;?>" target="_blank" class="lightbox" rel="flowers"> <img name="img_name"  style="margin:5px; opacity:1;" src='<?php echo $thumb_img;?>'/></a></div>
        <?php 
          	endforeach;
          endif;
          ?></td>
<!--          <td class='y-bg'>
              <img width=400 src='<?php echo $purchaseInfo['images']?>'>
          </td>-->
	</tr>
	<tr>
    <th width="120">联系信息：</th>
    <td class="y-bg"><?php echo '联系人：'.$purchaseInfo['contact_name'] . '&nbsp;&nbsp;联系电话：'. $purchaseInfo['contact_phone'] . '&nbsp;&nbsp;联系邮箱：'. $purchaseInfo['contact_email'];?></td>
	</tr>
	
  </table>
</div>
<div id="div_setting_2" class="contentList pad-10 hidden">
<table width="100%"  class="table_form">
<?php 
	if(isset($mesgList) && $mesgList):
		foreach ($mesgList as $msg):
?>
	<tr>
    <th width="150">
    <?php echo $msg['user_id'] ? '客户的回复': '管理员回复';?><br/>
				  <?php echo date('Y-m-d H:i:s', $msg['add_time']);?></th>
    <td class="y-bg"><?php echo $msg['description']?></td>
	</tr>
<?php 
		endforeach;
	endif;
?>	
  </table>
  <?php if($purchaseInfo['status']<2):?>
  <div class="bk15"></div> 
  <form action="__SELF__" method="post" id="myform">
  <table width="100%"  class="table_form">
  <tr>
    <th width="120">回复：</th>
    <td class="y-bg"><textarea name="description" id="description" cols="50" rows="5" style="width: 595px; height: 100px;"></textarea></td>
	</tr>
  </table>
  <div class="bk15"></div> 
  <input name="dosubmit" type="submit" value="提交" class="button">
  </form>
 	<?php endif;?>
</div>

</div>
</div>
</body>
</html>